//
//  DKHttpHelper.h
//  DanKU
//
//  Created by 吴斌 on 2023/10/1.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN
typedef void (^requestSuccessBlock)(NSInteger status, id data);
typedef void (^requestFailureBlock) (NSInteger status, NSString * msg);
@interface DKHttpHelper : NSObject
+ (instancetype)request;
- (void)GET:(NSString *)url params:(nullable id)params withJson:(BOOL)isRequestJson withIsLoad:(BOOL)isLoad success:(requestSuccessBlock)successHandler failure:(requestFailureBlock)failureHandler;
- (void)POST:(NSString *)url params:(nullable id)params withJson:(BOOL)isRequestJson withIsLoad:(BOOL)isLoad success:(requestSuccessBlock)successHandler failure:(requestFailureBlock)failureHandler;

- (void)POST:(NSString *)url params:(nullable id)params withData:(NSData *)fileData  success:(requestSuccessBlock)successHandler failure:(requestFailureBlock)failureHandler;
//不用加载
- (void)POST:(NSString *)url params:(nullable id)params withData:(NSData *)fileData withLoad:(BOOL)isLoad success:(requestSuccessBlock)successHandler failure:(requestFailureBlock)failureHandler;
@end

NS_ASSUME_NONNULL_END
